<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0056)http://shop.dongxiangsoft.com/shop/product.aspx -->
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD><TITLE>商城</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META content=IE=EmulateIE7 http-equiv=X-UA-Compatible>
<LINK rel=stylesheet href="css/detail.css">
<LINK rel=stylesheet href="css/reset.css">
<SCRIPT src="list_files/common.js"></SCRIPT>

<SCRIPT type=text/javascript src="list_files/jquery-1.3.1.js"></SCRIPT>
<LINK rel=stylesheet type=text/css 
href="list_files/indexcss.css">

<META name=GENERATOR content="MSHTML 9.00.8112.16450"></HEAD>

<!--导航栏-->
<?php require_once("shophead.php");
require_once("../config/dbconn.php");
$sql="select * from {$db_prefix}products where id='$id'";
$rs2=$db->get_one($sql);
//插入到购物车中
if($action=='buy'){
	$msg='';
	if (intval($num)<=0) $msg.="请输入购买数量\\n";
	if ($msg!=''){
		echo "<script>alert('$msg');history.back();</script>";exit();
	}
	setgoodscart($id,intval($num));
	
	if($_SESSION['sys_username'])
	{		echo "<script>location.href='index.php?action=buy';</script>";exit();}
        else{
                $msg='';
                $msg.="请先登录！\\n";                
                echo "<script>alert('$msg');location.href='index.php?action=buy';</script>";exit();
        }
}
?>
<body>
<div id="container">

  <!-- <div class="bread_crumbs" ></div> -->
  <div class="fruit_display"> 
    <div class="fl media big_w896 media_list" style=" width:500px; float:left;    border: 1px solid #ccc; ">
    		<img src="../uploads/productimgs/<?=$rs2['pimg']?>" width="500" height="400">
    </div>
    <div class="fr big_w510" style=" width:478px; float:left; margin:20px 0 0 20px;">
      <h2></h2>
     <form name="form1" method="post" action="?action=buy">
                <table width="100%" height="240" border="0" cellpadding="0" cellspacing="0">
                  <!--<tr style="border-bottom:1px #666666 dashed;">
                    <td height="30" style="font-size:14px; font-weight:bolder; " class="left_txt"><? if ($rs2['psortid']){
				  	$sql1="select flname,path from {$db_prefix}psort where id='".$rs2['psortid']."'";
					$rs1=$db->get_one($sql1);
				  	$cpath=$rs1['path'];
					$pathary=explode(',',$cpath);
					foreach($pathary as $k1=>$v1){
						$sqlf="select flname from {$db_prefix}psort where id='$v1'";
						$rsf=$db->get_one($sqlf);
						if ($k1>0) echo "--";
						echo $rsf['flname'];	
					}
					echo $rs1['flname'];
				  }?></td>
                  </tr>-->
                  <tr style="border-bottom:#666 1px dotted;">
                    <!--<td  class="left_txt">产品名：</td>-->
                    <div style=" width:478px; font-size:16px; font-weight:bolder; border-bottom:1px #666666 dotted;">
                    	<?=$rs2['productname']?>
                    </div>
                    <!--<td  class="left_txt"><?=$rs2['productname']?></td>-->
                  </tr>
                  <?php 
				  
									if($rs2['gcprice']!=0 && $rs2['price']!=0){
											$zk = 'block';
											$jf = 'block';
									}else if($rs2['gcprice']==0 && $rs2['price']!=0){
										$zk = 'block';
										$jf = 'none';
									}else{
										$zk = 'none';
										$jf = 'block';
									}
				  ?>
                  <tr style="display:<?=$zk?>;">
                    <td style="width:150px">市场价：&nbsp;&nbsp;&nbsp;<?=$rs2['scprice']?>元</td>
                    <td  class="left_txt"><label>
                      
                     </label></td>
                  </tr>
                  <tr style="display:<?=$zk?>;">
                    <td  style="width:150px">购物券：&nbsp;&nbsp;&nbsp;<?=$rs2['price']?>元</td>
                    <td height="30" class="left_txt">
                      </td>
                  </tr>
                  <tr style="display:<?=$jf?>;">
                    <td  style="width:150px">积分价：&nbsp;&nbsp;&nbsp;<?=$rs2['gcprice']?> 积分</td>
                    <td height="30" style="width:120px">
                     </td>
                  </tr>
                  <tr>
                    <td style="width:150px">赠送积分：&nbsp;&nbsp;&nbsp;<?=$rs2['pv']?></td>
                    <td style="width:150px;"></td>
                  </tr>
                  <tr style="border-bottom:#666 1px dotted;">
                  
                    <td height="30"  class="left_text">购买数量:<input name="num"  type="text" id="num" value="1" size="5">
                      件 </td>
                    <td class="left_txt"><label>
                      </label></td>
                  </tr>
                  <tr>
                    <td height="30" align="center">
					  <input name="id" type="hidden" id="id" value="<?=$id?>">
                      <input name="pageno" type="hidden" id="pageno" value="<?=$pageno?>"></td>
                    
                  </tr>
                  <tr>
                  	<td height="70" ><input type="image" src="images/goumai3.gif" width="120" height="36">
                      <label></label></td>
                  </tr>
                  <tr>
                    <td height="30" colspan="3" align="left" bgcolor="#FFFFFF"><label>
                     
                    </label></td>
                  </tr>
                </table>
                            </form>
  
      </div>
      <div class="clear"></div>
<div id="content">      
   <div class="left_content">
      <div class="games">
      	<div class="daohang">
			<span>热卖排行榜</span>
		</div>
        
        
					 <?
  $query='';
  if ($act=='query'){
  	if ($psortid!=''){
		$pstr='';
		$sqlf="select id,flname from {$db_prefix}psort where find_in_set('$psortid',path)>0 or id='$psortid'";
		$resultf=$db->query($sqlf);
		while($rsf=$db->fetch_array($resultf)){
			if ($pstr!='') $pstr.=',';$pstr.=$rsf['id'];
		}
		$db->free_result($resultf);
		
		if ($pstr!=''){
			$query.=" and find_in_set(psortid,'$pstr')>0";
		}
	}	
	if (trim($productname)!='') $query.=" and productname like '%".trim($productname)."%'";
	if (trim($price1)!='') $query.=" and price>='".trim($price1)."'";
	if (trim($price2)!='') $query.=" and price<='".trim($price2)."'";
	if (trim($scprice1)!='') $query.=" and scprice>='".trim($scprice1)."'";
	if (trim($scprice2)!='') $query.=" and scprice<='".trim($scprice2)."'";
	if (trim($pv1)!='') $query.=" and pv>='".trim($pv1)."'";
	if (trim($pv2)!='') $query.=" and pv<='".trim($pv2)."'";
  }
  
  $sql="select count(id) as c  from {$db_prefix}products where 1";
  if ($query!='') $sql.=$query;
  $rs=$db->get_one($sql);
  $page=new pagecls(24,intval($rs['c']));
  $sql="select * from {$db_prefix}products where 1 && selling=1";
  if ($query!='') $sql.=$query;
  $sql.=" order by id asc limit {$page->pastnum},{$page->pagesize}";
  $result=$db->query($sql);
  while($rs=$db->fetch_array($result)){
  ?>
					<div class="shangpin1">
						<div class="y2">
							<a href="product_order.php?id=<?=$rs['id']?>" target="_blank"><? if ($rs['pimg']) {?><img src="../uploads/productimgs/<?=$rs['pimg']?>" width="50px" height="50px"><? }?></a>
						</div>
						<div class="y3">
							<div class="top">
								<a href="product_order.php?id=<?=$rs['id']?>" target="_blank"><?=$rs['productname']?></a>
								<div class="bottom"><?=$rs['scprice']?></div>
							</div>
							
						</div>
					</div>
					<?
  }
  $db->free_result($result);
?> 
                    
                    
      </div>
   </div>   
   <div class="right_content">
      <div class="tjpj">
 	  	<div class="spjs">
			<!-- 标题导航 -->
			<div class="bt">
				<ul>
					<li class="title1">商品介绍</li>
					<!--<li class="title2">商品评价</li>-->
				</ul>
			</div>
			<!-- 商品信息 -->
			<div class="goods_messages">
				<ul>
					<li>商品名称:<?=$rs2['productname']?></li>
					<li>商品编号：<?=$rs2['id']?></li>
					<li>上架时间：<?=date('Y-m-d H:i:s',$rs2['addtime'])?></li>
				</ul>
			</div>
		</div>	
        <div class="pics">
			<div class="pic1">
                <?=stripslashes($rs2['content'])?>                    
				<!--<a><img style="width:600px;" src="../uploads/productimgs/<?=$rs2['pimg']?>"></a>-->
			</div>
					
		</div>	
      </div>
   </div>
</div>         
      
      
      
      
      
</div> 


     

      
      

<!--------------产品展示结束---------------->    
    <div class="clr"></div>
    <div class="w">
        <div id="footer">
            <div class="links">
                <a>关于我们</a>|<a href="#">联系我们</a>|<a href="#">人才招聘</a>|<a href="#">商家入驻</a>|<a href="#">广告服务</a>|<a href="{:U('Link/index')}">友情链接</a>|<a href="#">销售联盟</a>
            </div>
            <div class="copyright">
              
            </div>
        </div>
    </div>
    <div class="goto">
        <div class="panel" id="back_top">
            <div class="backpanel-inner">
                <div class="back_to_top"><a href="javascript:;">返回顶部</a></div>
            </div>
        </div>
    </div>
    

</body>
</html>
						



							
							
							
							
							
							


